package com.special.threademo.concurrency.waitNotify;

/**
 * Created with IDEA202013
 * author:LiuYC
 * DateTime:2021/1/6  15:21
 */
public class WaitAndSleep {
    public static void main(String[] args) throws InterruptedException {
        Object o = new Object();
        /**
         * 在调用wait方法时，线程必须要有调用的对象的锁，当调用wait方法时候，线程会释放掉该对象的锁。、
         * 在调用thread 的sleep方法时，线程不会释放掉对应的锁
         *
         */
        // o.wait();
        synchronized (o) {
            o.wait();
        }
    }
}
